package com.hu.common.domain.base;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.hu.dao.entity.AuthUserBO;
import org.springframework.beans.BeanUtils;

import java.util.List;

/**
 * 用户
 *
 * @author 63198
 * @date 16:25 2018/2/27
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class UserVO extends AuthUserBO {

    private List<String> roleCodes;

    private List<String> dataRange;

    private List<Long> postRange;

    private String token;

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public UserVO() {
        super();
    }

    public UserVO(AuthUserBO authUserBO) {
        BeanUtils.copyProperties(authUserBO, this);
        this.setPassword(null);
        this.setSalt(null);
    }

    public List<String> getRoleCodes() {
        return roleCodes;
    }

    public void setRoleCodes(List<String> roleCodes) {
        this.roleCodes = roleCodes;
    }

    public List<String> getDataRange() {
        return dataRange;
    }

    public void setDataRange(List<String> dataRange) {
        this.dataRange = dataRange;
    }

    public List<Long> getPostRange() {
        return postRange;
    }

    public void setPostRange(List<Long> postRange) {
        this.postRange = postRange;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
